﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 徐汉权
{
    class Program
    {
        static void Main(string[] args)
        {
            //For循环
            //求1~10的和
            int Num = 0;
            for(int i = 1; i <= 10; i++)
            {
                Num += i;
            }
            Console.WriteLine("1~10的和为：" + Num);

            //FOr双重循环
            //九九乘法表
            string Str = "";
            for(int i = 1; i < 10; i++)
            {
                for(int j = 1; j <= i; j++)
                {
                    Str += "" + j + "x" + i + "=" + i * j + "\t";
                }
                Str += "\n";
            }
            Console.Write(Str);

            //if else 
            Console.WriteLine("请输入一个整数，我们将判断它是偶数或是奇数！");
            int Sum = int.Parse(Console.ReadLine());
            if(Sum % 2 == 0)
            {
                Console.WriteLine("这个数是整数");
            } else if (Sum % 2 == 1)
            {
                Console.WriteLine("这个数是奇数");
            }

            //Switch 语句
            Console.WriteLine("欢迎来到徐右右的自助水果店，请输入您想要咨询的水果");
            string Sry = Console.ReadLine();
            Console.WriteLine(Sry);
            switch (Sry)
            {
                case "苹果":
                    Console.WriteLine("8元/斤");
                    break;
                case "香蕉":
                    Console.WriteLine("6元/斤");
                    break;
                case "香梨":
                    Console.WriteLine("12元/斤");
                    break;
                case "草莓":
                    Console.WriteLine("15元/斤");
                    break;
                case "黑提":
                    Console.WriteLine("18元/斤");
                    break;
                default:
                    Console.WriteLine("抱歉！因为疫情原因，暂时其他货物紧缺，无法提供!还请见谅！");
                    break;
            }
            }
        }
    }

